function createIssueModule(){
    // Home Store and grid
	var issueHomeStore = CRM.commons.createStore('issueHomeStore',CRM.SPComp.dashboardDataArray,'searchIssueDashboard/issueByProjectId');
	var issueHomeGrid=CRM.commons.createGrid('issueHomeGrid', issueHomeStore, CRM.SPComp.createDashboardColumnModel('issueHomeGrid'));
	// My Issue Store and grid
	var myIssueStore=CRM.commons.createStore('myIssueStore',CRM.SPComp.dashboardDataArray,'searchIssueDashboard/issueForm');
	var myIssueGrid=CRM.commons.createGrid('myIssueGrid',myIssueStore,CRM.SPComp.createDashboardColumnModel('myIssueGrid'));  
	// common for home and Issue DropDown List
	var projecthomeStore=CRM.commons.createComboStore('projecthomeStore','searchIssueDashboard/issueDropDownList?operation='+"projects"); 
	var memberhomeStore=CRM.commons.createComboStore('memberhomeStore','searchIssueDashboard/issueDropDownList');
	var priorityhomeStore=CRM.commons.createComboStore('priorityhomeStore','searchIssueDashboard/issueDropDownList?operation='+"priority"); 

    var criteriaPanel = { 
				 xtype       : 'fieldset',
				 title		 : 'Search Issues', 
			     id          : 'criteriaPanel',
			     width       : '98%', 
			     labelWidth  : 120,
			     border      : true,
			     layout      : 'hbox',
			     items       : [
			                      {
			                    	 xtype : 'compositefield',
			                    	 items : [



											  { xtype : 'displayfield', value : '<b>Assigned To :</b> '},
			                       			  { 
			                       				    xtype        : 'combo',
			                                        id           : 'homeAssignedTo',  
			                                        valueField   : 'id',
			                                        store        :  memberhomeStore,
			                                        displayField : 'name',
			                                        triggerAction: 'all',
			                                        typeAhead    : true,
			                                        editable     : false,
			                                        autoLoad     : false,
			                                        width        : 180,
			                                        mode         : 'local'
			                       				} ,
			                    	            { 	xtype : 'displayfield', value : '<b>Project <font color=red>*</font>:<b>'},
			                       			    {
			                    	   			    xtype 		: 'combo',
			                    	   				id	  		: 'homeProjectId',
			                    	   				store		:  projecthomeStore,
			                                        displayField: 'name',
			                                        valueField  : 'id',
			                                        triggerAction:'all',
			                    	   				width 		: 180,
			                    	   				editable	: false,
			                    	   			    listeners	: {select : function(combo,record,index){
			                    	            	memberhomeStore.reload({
			        					       			params:{
			        					       			operation:'members',
			        					       			projectId:record.get('id')
			        					       			
			        					       		             }
			        					       		        });
			                    			      } 
			                    	            }				  
			                       				},
			                       			    { xtype : 'displayfield', value : '<b>Priority : </b>'},
			                       				{
			                                        xtype        : 'combo',
			                                        id           : 'homePriority', 
			                                        valueField   : 'id',
			                                        store        : priorityhomeStore  ,      
			                                        displayField : 'name',
			                                        triggerAction: 'all',
			                                        typeAhead    : true,
			                                        editable     : false,
			                                        autoLoad     : false,
			                                        width        : 180
			                       				}, 
			                       				 {
				                       				xtype 		 : 'button',
					                       			text  	     : 'Search', 
					                       			handler:function(){
			        					       		var projId=Ext.getCmp('homeProjectId');
			        					       		var pritId=Ext.getCmp('homePriority');
			        					       		var assignId=Ext.getCmp('homeAssignedTo');
			        					            issueHomeGrid.store.reload({
			        					       			params:{
			        					       			projectId:projId.getValue(),
			        					       			priorityId:pritId.getValue(),
			        					       			assigntoId:assignId.getValue()
			        					       		      }
			        					       		   });
			        					       		}
			                       				
				                       			 },
			                        				 {
			                       				   	xtype	: 'button',
			                       				   	text	: 'Clear Search',
			                       				   	handler : function(){
			                       				    			issueHomeGrid.store.removeAll();
			                       				    			 }
			                       				  }
			                       				
			                    			]
			                       }]
					};
			 
	          
		       
		     	
	var issueDashboard = {
		xtype    : 'panel',
		width	 : '100%', 
        frame	 : true,
        title	 : 'Issue Dashboard', 
        iconCls  : 'icon-grid',
  		items 	 : [issueHomeGrid]
	}; 
	
			
	 var issueHome = new Ext.form.FormPanel({
 		width    : '100%',
 		padding	 : '5px',
 		title	:'Issue DashBoard',
 		id		:'issueHome',
 		frame	 : true,
 		height   : 450,
 		items 	 : [criteriaPanel,issueDashboard]
	}); 
		     	
    var myIssueHeaderPanel={
			xtype       : 'fieldset',
			title       : 'My Issues',
			id          :'myIssueHeaderpanel',
			height      : 80,
			width       : '98%', 
			labelWidth  : 120,
		    border      : true,
		    frame       : false,
		    layout      : 'hbox',
			items       :[
			              {	
			            	  xtype:'compositefield',
			       		      items:[
			       	                  { xtype:'displayfield',html:'<b>Project :<b>'},
								      {
								       	  xtype         : 'combo',
								       	  id            : 'myissueproject',
								       	  store	        :  projecthomeStore,
								          displayField  : 'name',
								       	  valueField  	: 'id',
								       	  triggerAction : 'all',
								       	  width		    : 160,
								       	  editable	    : false
								      },
			       	                  {xtype:'displayfield',html:'<b>Priority : </b>'},
							       	  {
							       		 xtype    	    : 'combo',
							       		 id       	    : 'myissuepriority',
							       		 store		    : priorityhomeStore,
							       		 displayField   : 'name',
							       		 valueField  	: 'id',
							       		 triggerAction  : 'all',
							       		 width		    : 160,
							       		 editable		: false
							       	 },
			       	                 {
							       		 xtype          :'button',
							       		 text           :'Search',
			       		                 handler        :function(){
								       		var issueprojid=Ext.getCmp('myissueproject');
								       		var issuepritid=Ext.getCmp('myissuepriority');
								       		myIssueStore.reload({
								       			params:{
								       			projectId:issueprojid.getValue(),
								       			priorityId:issuepritid.getValue(),
			       			                    assigntoId:0
			       		                                }
			       		                                       });
			       	                           }
			       	                    }
			                 ]}

			           ]
	     };
     var myIssueGridPanel ={
    		 xtype : 'panel',
    		 title : 'MY ISSUEGRID',
    		 id    : 'myIssueGridPanel',
    		 width : '100%',
    		 frame : true,
    		 iconCls :'MyIssueIcon',
    		 items : [myIssueGrid]
    		
     };
	 var myIssue=new Ext.form.FormPanel({
			
			title	:'My Issue', 
			id		:'myIssue',
			padding	 : '5px',
			frame    : true,
			width    : '100%',
			autoScroll: true,
			height   : 450,
			items	:[myIssueHeaderPanel,myIssueGridPanel]
	});
	
	var issueDetail={
		xtype	:'panel',
		title	:'Add NewIssue',
		id		:'issueDetail',
		items	:[createIssueDetails()]  
	};
	
	
	var issueModuleTabs=new Ext.TabPanel({
		
		id:'issueModuleTabs', 
		items:[issueHome,myIssue,issueDetail] 
	});
	return issueModuleTabs;
}

